﻿using Architecture.CrossCutting.Common;
using Architecture.CrossCutting.LoggingEntities;
using Architecture.CrossCutting.RepositoryPattern.Logging;
using Architecture.CrossCutting.Web.IOC;
using Architecture.CrossCutting.Web.Tracing;
using Architecture.CrossCutting.Web.WebApi;
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Data.Entity.Infrastructure.Interception;
using System.Diagnostics;
using System.Linq;
using System.Web.Http;

namespace Architecture.Presentation.WebApiServices2
{
    public static class LoggingConfig
    {
        public static void Register()
        {
            ETWEFLogger _logger = new ETWEFLogger();
            DbInterception.Add(new EFInterceptor(_logger));


            //WebApiTraceWriter traceWriter = CustomContext.Current.DependencyResolver.GetService<WebApiTraceWriter>();
            //GlobalConfiguration.Configuration.Services.Replace(typeof(System.Web.Http.Tracing.ITraceWriter), traceWriter );
            //GlobalConfiguration.Configuration.Services.Replace(typeof(System.Web.Http.Tracing.ITraceWriter), new WebApiEtwTraceWriter());

            //var diagHandler = CustomContext.Current.DependencyResolver.GetService<WebApiDiagnostic>();
            //GlobalConfiguration.Configuration.MessageHandlers.Add(diagHandler);

        }
    }
}
